package Task1;

public abstract class role {
    String name;
    int HP;
    int MP;

    public role() {
    }

    public role(String name, int HP, int MP) {
        this.name = name;
        this.HP = HP;
        this.MP = MP;
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return HP
     */
    public int getHP() {
        return HP;
    }

    /**
     * 设置
     * @param HP
     */
    public void setHP(int HP) {
        this.HP = HP;
    }

    /**
     * 获取
     * @return MP
     */
    public int getMP() {
        return MP;
    }

    /**
     * 设置
     * @param MP
     */
    public void setMP(int MP) {
        this.MP = MP;
    }

    public String toString() {
        return "role{name = " + name + ", HP = " + HP + ", MP = " + MP + "}";
    }
    public void show(){
        System.out.println(name+" 剩余血量"+HP+" 剩余法力值" + MP);
    }

}
